Skip to content

refactor: consolidate TOML parsers to smol-toml#507

Merged
Strum355 merged 1 commit into
guacsec:mainfrom
Strum355:chore/consolidate-toml-parser
May 8, 2026
Merged

refactor: consolidate TOML parsers to smol-toml#507
Strum355 merged 1 commit into
guacsec:mainfrom
Strum355:chore/consolidate-toml-parser

Conversation

@Strum355

@Strum355 Strum355 commented May 8, 2026

Copy link
Copy Markdown
Member

Summary

  • Replace fast-toml (TOML 0.5, unmaintained) with smol-toml (TOML 1.0, actively maintained) in the Gradle provider
  • Unifies the codebase on a single TOML parsing library — smol-toml was already used in 4 other providers (Cargo, Poetry, UV, base_pyproject)
  • Moves smol-toml from devDependencies to dependencies where it belongs

Test plan

  • Verify Gradle version catalog resolution still works (libs.versions.toml parsing)
  • Verify existing TOML-dependent providers (Cargo, Poetry, UV) are unaffected

🤖 Generated with Claude Code

Summary by Sourcery

Consolidate TOML parsing onto smol-toml and update the Gradle provider to use the unified parser.

Enhancements:

  • Refactor the Gradle provider to use the shared smol-toml parser for version catalog (libs.versions.toml) resolution.

Build:

  • Replace the fast-toml runtime dependency with smol-toml and move smol-toml from devDependencies to dependencies for consistent TOML parsing across providers.

@sourcery-ai

sourcery-ai Bot commented May 8, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Refactors TOML handling to standardize on the smol-toml parser across the Gradle provider and project dependencies, replacing fast-toml and updating usage accordingly.

Class diagram for Java_gradle TOML parsing refactor

classDiagram
  class Base_java
  class Java_gradle {
    +resolveAliasFromToml(manifestPath, alias)
  }
  class SmolToml {
    +parseToml(tomlString)
  }

  Java_gradle --|> Base_java
  Java_gradle ..> SmolToml : uses
Loading

File-Level Changes

Change Details Files
Switch Gradle provider TOML parsing from fast-toml to smol-toml
  • Replace TOML.parse usage with parseToml for reading libs.versions.toml in the Gradle provider
  • Ensure the TOML parsing call site remains functionally equivalent for resolving library aliases and group/artifact coordinates
src/providers/java_gradle.js
Standardize TOML library dependency on smol-toml in project configuration
  • Remove fast-toml from runtime dependencies
  • Promote smol-toml from devDependencies to dependencies to reflect runtime usage
  • Update lockfile entries to reflect removal of fast-toml and addition/promotion of smol-toml
package.json
package-lock.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • Since smol-toml is stricter and TOML 1.0 compliant, consider checking whether any Gradle libs.versions.toml files that previously parsed now fail and, if so, whether you want to surface a clearer error message or fallback behavior for those cases.
  • Now that smol-toml is the single TOML dependency, it may be worth scanning for any remaining fast-toml-style usage patterns (e.g., namespace vs. function imports) to ensure all providers are using a consistent import/parse pattern.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Since `smol-toml` is stricter and TOML 1.0 compliant, consider checking whether any Gradle `libs.versions.toml` files that previously parsed now fail and, if so, whether you want to surface a clearer error message or fallback behavior for those cases.
- Now that `smol-toml` is the single TOML dependency, it may be worth scanning for any remaining `fast-toml`-style usage patterns (e.g., namespace vs. function imports) to ensure all providers are using a consistent import/parse pattern.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@Strum355
Strum355 force-pushed the chore/consolidate-toml-parser branch 2 times, most recently from 4503bfb to 884cce3 Compare May 8, 2026 10:28
Replace fast-toml (TOML 0.5, unmaintained) with smol-toml (TOML 1.0,
actively maintained) in the Gradle provider, unifying the codebase on
a single TOML library.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Strum355
Strum355 force-pushed the chore/consolidate-toml-parser branch from 884cce3 to 61f475e Compare May 8, 2026 10:29
@Strum355
Strum355 requested a review from ruromero May 8, 2026 10:30
@Strum355
Strum355 enabled auto-merge (squash) May 8, 2026 10:30
@Strum355
Strum355 merged commit e645720 into guacsec:main May 8, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants